import request from '@/utils/request'

// 查询设备收益详情列表
export function listEarnings(query) {
  return request({
    url: '/producer/earnings/list',
    method: 'get',
    params: query
  })
}

// 查询设备收益详情详细
export function getEarnings(id) {
  return request({
    url: '/producer/earnings/' + id,
    method: 'get'
  })
}

// 新增设备收益详情
export function addEarnings(data) {
  return request({
    url: '/producer/earnings',
    method: 'post',
    data: data
  })
}

// 修改设备收益详情
export function updateEarnings(data) {
  return request({
    url: '/producer/earnings',
    method: 'put',
    data: data
  })
}

// 删除设备收益详情
export function delEarnings(id) {
  return request({
    url: '/producer/earnings/' + id,
    method: 'delete'
  })
}
// 查询设备收益列表总收益
export function totalIncome(data) {
  return request({
    url: '/producer/earnings/total/income',
    method: 'GET',
    params: data
  })
}
